package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="member" )
public class Member extends BaseObject implements Serializable {
    private Long memberId;
    private Long memberLvId;
    private String uname;
    private String name;
    private String password;
    private String area;
    private String mobile;
    private String tel;
    private String email;
    private String zip;
    private String addr;
    private String province;
    private String city;
    private Long orderNum;
    private short BYear;
    private byte BMonth;
    private byte BDay;
    private boolean sex;
    private boolean wedlock;
    private String education;
    private String vocation;
    private String interest;
    private Long pointFreeze;
    private Long pointHistory;
    private Long point;
    private String regIp;
    private Long regTime;
    private byte state;
    private String passwordAnswer;
    private String passwordQuestion;
    private Long loginCount;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getMemberId() {
        return this.memberId;
    }
    
    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }
    
    @Column(name="member_lv_id", nullable=false)
    public Long getMemberLvId() {
        return this.memberLvId;
    }
    
    public void setMemberLvId(Long memberLvId) {
        this.memberLvId = memberLvId;
    }
    
    @Column(name="uname", nullable=false, length=50)
    public String getUname() {
        return this.uname;
    }
    
    public void setUname(String uname) {
        this.uname = uname;
    }
    
    @Column(name="name", nullable=false, length=50)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="password", nullable=false, length=50)
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    @Column(name="area", nullable=false)
    public String getArea() {
        return this.area;
    }
    
    public void setArea(String area) {
        this.area = area;
    }
    
    @Column(name="mobile", nullable=false, length=30)
    public String getMobile() {
        return this.mobile;
    }
    
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    
    @Column(name="tel", nullable=false, length=30)
    public String getTel() {
        return this.tel;
    }
    
    public void setTel(String tel) {
        this.tel = tel;
    }
    
    @Column(name="email", nullable=false, length=100)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="zip", nullable=false, length=20)
    public String getZip() {
        return this.zip;
    }
    
    public void setZip(String zip) {
        this.zip = zip;
    }
    
    @Column(name="addr", nullable=false)
    public String getAddr() {
        return this.addr;
    }
    
    public void setAddr(String addr) {
        this.addr = addr;
    }
    
    @Column(name="province", nullable=false, length=20)
    public String getProvince() {
        return this.province;
    }
    
    public void setProvince(String province) {
        this.province = province;
    }
    
    @Column(name="city", nullable=false, length=20)
    public String getCity() {
        return this.city;
    }
    
    public void setCity(String city) {
        this.city = city;
    }
    
    @Column(name="order_num", nullable=false)
    public Long getOrderNum() {
        return this.orderNum;
    }
    
    public void setOrderNum(Long orderNum) {
        this.orderNum = orderNum;
    }
    
    @Column(name="b_year", nullable=false)
    public short getBYear() {
        return this.BYear;
    }
    
    public void setBYear(short BYear) {
        this.BYear = BYear;
    }
    
    @Column(name="b_month", nullable=false)
    public byte getBMonth() {
        return this.BMonth;
    }
    
    public void setBMonth(byte BMonth) {
        this.BMonth = BMonth;
    }
    
    @Column(name="b_day", nullable=false)
    public byte getBDay() {
        return this.BDay;
    }
    
    public void setBDay(byte BDay) {
        this.BDay = BDay;
    }
    
    @Column(name="sex", nullable=false)
    public boolean isSex() {
        return this.sex;
    }
    
    public void setSex(boolean sex) {
        this.sex = sex;
    }
    
    @Column(name="wedlock", nullable=false)
    public boolean isWedlock() {
        return this.wedlock;
    }
    
    public void setWedlock(boolean wedlock) {
        this.wedlock = wedlock;
    }
    
    @Column(name="education", nullable=false, length=30)
    public String getEducation() {
        return this.education;
    }
    
    public void setEducation(String education) {
        this.education = education;
    }
    
    @Column(name="vocation", nullable=false, length=50)
    public String getVocation() {
        return this.vocation;
    }
    
    public void setVocation(String vocation) {
        this.vocation = vocation;
    }
    
    @Column(name="interest", nullable=false)
    public String getInterest() {
        return this.interest;
    }
    
    public void setInterest(String interest) {
        this.interest = interest;
    }
    
    @Column(name="point_freeze", nullable=false)
    public Long getPointFreeze() {
        return this.pointFreeze;
    }
    
    public void setPointFreeze(Long pointFreeze) {
        this.pointFreeze = pointFreeze;
    }
    
    @Column(name="point_history", nullable=false)
    public Long getPointHistory() {
        return this.pointHistory;
    }
    
    public void setPointHistory(Long pointHistory) {
        this.pointHistory = pointHistory;
    }
    
    @Column(name="point", nullable=false)
    public Long getPoint() {
        return this.point;
    }
    
    public void setPoint(Long point) {
        this.point = point;
    }
    
    @Column(name="reg_ip", nullable=false, length=16)
    public String getRegIp() {
        return this.regIp;
    }
    
    public void setRegIp(String regIp) {
        this.regIp = regIp;
    }
    
    @Column(name="reg_time", nullable=false)
    public Long getRegTime() {
        return this.regTime;
    }
    
    public void setRegTime(Long regTime) {
        this.regTime = regTime;
    }
    
    @Column(name="state", nullable=false)
    public byte getState() {
        return this.state;
    }
    
    public void setState(byte state) {
        this.state = state;
    }
    
    @Column(name="password_answer", nullable=false, length=250)
    public String getPasswordAnswer() {
        return this.passwordAnswer;
    }
    
    public void setPasswordAnswer(String passwordAnswer) {
        this.passwordAnswer = passwordAnswer;
    }
    
    @Column(name="password_question", nullable=false, length=250)
    public String getPasswordQuestion() {
        return this.passwordQuestion;
    }
    
    public void setPasswordQuestion(String passwordQuestion) {
        this.passwordQuestion = passwordQuestion;
    }
    
    @Column(name="login_count", nullable=false)
    public Long getLoginCount() {
        return this.loginCount;
    }
    
    public void setLoginCount(Long loginCount) {
        this.loginCount = loginCount;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Member pojo = (Member) o;

        if (memberLvId != null ? !memberLvId.equals(pojo.memberLvId) : pojo.memberLvId != null) return false;
        if (uname != null ? !uname.equals(pojo.uname) : pojo.uname != null) return false;
        if (name != null ? !name.equals(pojo.name) : pojo.name != null) return false;
        if (password != null ? !password.equals(pojo.password) : pojo.password != null) return false;
        if (area != null ? !area.equals(pojo.area) : pojo.area != null) return false;
        if (mobile != null ? !mobile.equals(pojo.mobile) : pojo.mobile != null) return false;
        if (tel != null ? !tel.equals(pojo.tel) : pojo.tel != null) return false;
        if (email != null ? !email.equals(pojo.email) : pojo.email != null) return false;
        if (zip != null ? !zip.equals(pojo.zip) : pojo.zip != null) return false;
        if (addr != null ? !addr.equals(pojo.addr) : pojo.addr != null) return false;
        if (province != null ? !province.equals(pojo.province) : pojo.province != null) return false;
        if (city != null ? !city.equals(pojo.city) : pojo.city != null) return false;
        if (orderNum != null ? !orderNum.equals(pojo.orderNum) : pojo.orderNum != null) return false;
         if (sex != pojo.sex) return false;
        if (wedlock != pojo.wedlock) return false;
        if (education != null ? !education.equals(pojo.education) : pojo.education != null) return false;
        if (vocation != null ? !vocation.equals(pojo.vocation) : pojo.vocation != null) return false;
        if (interest != null ? !interest.equals(pojo.interest) : pojo.interest != null) return false;
        if (pointFreeze != null ? !pointFreeze.equals(pojo.pointFreeze) : pojo.pointFreeze != null) return false;
        if (pointHistory != null ? !pointHistory.equals(pojo.pointHistory) : pojo.pointHistory != null) return false;
        if (point != null ? !point.equals(pojo.point) : pojo.point != null) return false;
        if (regIp != null ? !regIp.equals(pojo.regIp) : pojo.regIp != null) return false;
        if (regTime != null ? !regTime.equals(pojo.regTime) : pojo.regTime != null) return false;
         if (passwordAnswer != null ? !passwordAnswer.equals(pojo.passwordAnswer) : pojo.passwordAnswer != null) return false;
        if (passwordQuestion != null ? !passwordQuestion.equals(pojo.passwordQuestion) : pojo.passwordQuestion != null) return false;
        if (loginCount != null ? !loginCount.equals(pojo.loginCount) : pojo.loginCount != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (memberLvId != null ? memberLvId.hashCode() : 0);
        result = 31 * result + (uname != null ? uname.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (area != null ? area.hashCode() : 0);
        result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
        result = 31 * result + (tel != null ? tel.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (zip != null ? zip.hashCode() : 0);
        result = 31 * result + (addr != null ? addr.hashCode() : 0);
        result = 31 * result + (province != null ? province.hashCode() : 0);
        result = 31 * result + (city != null ? city.hashCode() : 0);
        result = 31 * result + (orderNum != null ? orderNum.hashCode() : 0);
 
        result = 31 * result + (sex ? 1 : 0);
        result = 31 * result + (wedlock ? 1 : 0);
        result = 31 * result + (education != null ? education.hashCode() : 0);
        result = 31 * result + (vocation != null ? vocation.hashCode() : 0);
        result = 31 * result + (interest != null ? interest.hashCode() : 0);
        result = 31 * result + (pointFreeze != null ? pointFreeze.hashCode() : 0);
        result = 31 * result + (pointHistory != null ? pointHistory.hashCode() : 0);
        result = 31 * result + (point != null ? point.hashCode() : 0);
        result = 31 * result + (regIp != null ? regIp.hashCode() : 0);
        result = 31 * result + (regTime != null ? regTime.hashCode() : 0);
         result = 31 * result + (passwordAnswer != null ? passwordAnswer.hashCode() : 0);
        result = 31 * result + (passwordQuestion != null ? passwordQuestion.hashCode() : 0);
        result = 31 * result + (loginCount != null ? loginCount.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("memberId").append("='").append(getMemberId()).append("', ");
        sb.append("memberLvId").append("='").append(getMemberLvId()).append("', ");
        sb.append("uname").append("='").append(getUname()).append("', ");
        sb.append("name").append("='").append(getName()).append("', ");
        sb.append("password").append("='").append(getPassword()).append("', ");
        sb.append("area").append("='").append(getArea()).append("', ");
        sb.append("mobile").append("='").append(getMobile()).append("', ");
        sb.append("tel").append("='").append(getTel()).append("', ");
        sb.append("email").append("='").append(getEmail()).append("', ");
        sb.append("zip").append("='").append(getZip()).append("', ");
        sb.append("addr").append("='").append(getAddr()).append("', ");
        sb.append("province").append("='").append(getProvince()).append("', ");
        sb.append("city").append("='").append(getCity()).append("', ");
        sb.append("orderNum").append("='").append(getOrderNum()).append("', ");
        sb.append("BYear").append("='").append(getBYear()).append("', ");
        sb.append("BMonth").append("='").append(getBMonth()).append("', ");
        sb.append("BDay").append("='").append(getBDay()).append("', ");
        sb.append("sex").append("='").append(isSex()).append("', ");
        sb.append("wedlock").append("='").append(isWedlock()).append("', ");
        sb.append("education").append("='").append(getEducation()).append("', ");
        sb.append("vocation").append("='").append(getVocation()).append("', ");
        sb.append("interest").append("='").append(getInterest()).append("', ");
        sb.append("pointFreeze").append("='").append(getPointFreeze()).append("', ");
        sb.append("pointHistory").append("='").append(getPointHistory()).append("', ");
        sb.append("point").append("='").append(getPoint()).append("', ");
        sb.append("regIp").append("='").append(getRegIp()).append("', ");
        sb.append("regTime").append("='").append(getRegTime()).append("', ");
        sb.append("state").append("='").append(getState()).append("', ");
        sb.append("passwordAnswer").append("='").append(getPasswordAnswer()).append("', ");
        sb.append("passwordQuestion").append("='").append(getPasswordQuestion()).append("', ");
        sb.append("loginCount").append("='").append(getLoginCount()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
